/**
 *
 */
package com.siteseat.common.misc;

import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.util.Properties;

import org.apache.commons.io.IOUtils;


/**
 *
 */
public class PropUtils extends org.apache.commons.io.FileUtils {

  /**
   * @param propFile
   * @return
   */
  public static Properties loadFrom( File propFile ) throws IOException {
    FileHelper.validateFile( propFile );

    Properties props = new Properties();
    InputStream fi = new FileInputStream( propFile );
    try {
      props.load( fi );
    } finally {
      IOUtils.closeQuietly( fi );
    }

    return props;
  }

}
